package com.pzl.dashboardview;

import android.graphics.Canvas;
import android.util.Log;
import android.view.MotionEvent;

/**
 * Created by zl.peng on 2016-02-02.
 */
abstract class BaseDialPlate implements DialPlate {
    private static final String TAG = "BaseDialPlate";
    protected int mMaxValue = 0;
    protected int mSegmentNum = 0;
    protected int mWidth = 0;
    protected int mHeight = 0;
    protected int mUnitValue = -1;
    protected int mMinSize = 0;

    @Override
    public void onDraw(DashboardView dashboardView, Canvas canvas) {
        mMaxValue = dashboardView.getmMaxValue();
        mSegmentNum = dashboardView.getmSegmentNum();
        mUnitValue = (mSegmentNum == 0 ? -1 : mMaxValue / mSegmentNum);
        mWidth = dashboardView.getmWidth();
        mHeight = dashboardView.getHeight();
        mMinSize = mWidth > mHeight ? mHeight : mWidth;
    }

    @Override
    public boolean onTouchEvent(MotionEvent event) {
        return false;
    }

    @Override
    public void setStaticValue(int staticValue) {
    }

    @Override
    public void onUpdate(int currentValue) {
    }
}
